<%-- 
    Document   : ResumenDeuda
    Created on : 14-oct-2012, 16:52:43
    Author     : Pavilion
--%>

<%@page import="Clases.Propiedades" %>
<%@page import="Clases.Usuario" %>
<%@page import="Clases.Boletas" %>
<%@page import="Clases.ConectarBD" %>
<%@page import="java.util.*,com.mysql.jdbc.Connection,java.sql.*,java.text.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<% if (session.getAttribute("elUsuario")==null) {
        response.sendRedirect("index.jsp");
    } else {
        HttpSession miSesion = request.getSession();
        Usuario esteUsuario = (Usuario) miSesion.getAttribute("elUsuario");   
    }
    String IDInmueble = request.getParameter("id_inmueble"); 
    int ID = Integer.parseInt(IDInmueble);       
    float sumaDeuda = 0;
    DecimalFormat fd = new DecimalFormat ("#,##0.00");
 %>

<html>
<head>
	<title>Resumen de deuda</title>
	<link rel=StyleSheet href="styles.css" type="text/css"/>
</head>

<body class="ubicacion" style="margin: auto"> 
<HR style="size: 2; color: negro"/>
<div class="header" >
<div style="width: 100px; height: 100px; display: inline-block">
    <img src="imagenes\escudodeseado.jpg" Style="text-decoration:underline; width: 100px; height: 100px; border: 0px; padding: 0px; margin: 0px;" alt="" />
</div>
<Div  style="width: 700px; height: 100px; background-color: blue; display: inline-block; vertical-align: top"  > 
    <H4>MUNICIPALIDAD DE PUERTO DESEADO</H4>
    <H5>Agencia de Recaudaci&oacute;n Municipal</H5>
</Div>
</div>
<HR style="size: 2; color: negro"/>
<div style="width: 100%; height: 30px; background-color: rgba(128, 128, 128, 0.19)" >
    <h1 class="h12" style="color: blue; margin-top: 5px; margin-bottom: 5px">Resumen de deuda</h1>
</div> 
<HR style="size: 2; color: negro"/>
<% HttpSession miSesion = request.getSession(); %>
<jsp:useBean id="casa" class="Clases.Propiedades" />
   <% casa.cargarInmueble(Integer.valueOf(request.getParameter("id_inmueble"))); %>

<div style="width: 300px; height: 190px; background-color: rgba(128, 128, 128, 0.19); display: inline-block; vertical-align: top" >
    <div class="h12" style="margin-top:0px; color: white; background-color: gray"><h9>TITULAR DE LA CUENTA</h9></div>   
 <div>      
     <div class="bordes1" style="margin-top: 7px; display: inline-block; width: 80px"><p class="h10">Nombre: </p></div><div class="bordes1" style="margin-top: 7px; display: inline-block; width: 210px"><%= miSesion.getAttribute("denominacion") %></div> 
 </div>
 <div >
     <div class="bordes1" style="margin-top: 10px; width: 90px; display: inline-block; vertical-align: top" ><p class="h10">Direcci&oacute;n: </p></div><div class="bordes1" style="margin-top: 10px; display: inline-block; width: 200px"><%= miSesion.getAttribute("direccionUs") %></div> 
</div >
</div>

<div style="width: 500px; height: 190px; background-color: rgba(128, 128, 128, 0.19); display: inline-block; vertical-align: top">
    <div class="h12" style="color: white; background-color: gray"><h9>DATOS DE LA PROPIEDAD</h9></div>   
 <div>
   <div class="bordes1" style="margin-top: 5px; display: inline-block; width: 180px"><p class="h10">Nro. de Catastro: </p></div><div class="bordes1" style="margin-top: 5px; display: inline-block; width: 300px"><jsp:getProperty name="casa" property="designacionCatastro" /></div>
   <div class="bordes1" style="margin-top: 5px; display: inline-block; width: 180px"><p class="h10">Valor Fiscal: $  </p></div><div class="bordes1" style="margin-top: 5px; display: inline-block; width: 300px"><jsp:getProperty name="casa" property="baseImponibleString" /></div>
  <div class="bordes1" style="margin-top: 5px; display: inline-block; width: 90px; vertical-align: top"><p class="h10">Direcci&oacute;n: </p></div><div class="bordes1" style="margin-top: 5px; display: inline-block; width: 405px"><jsp:getProperty name="casa" property="direccion" /></div>
 </div> 
</div>
<HR style="size: 2; color: negro"/>

<div>
   <table align="center" width="85%" border="0" style="margin-top: 30px; margin-bottom: 40px">
        <tr style="background-color: gray">
            <td width="15%"><p class="h10">Per&iacute;odo</p></td>
            <td width="25%"><p class="h10">Deuda Original</p></td>
            <td width="25%"><p class="h10">Deuda Actual</p></td>               
            <td width="25%"><p class="h10">Vencimiento Original</p></td>
            <td width="10%"><p class="h10">Mora (Meses)</p></td> 
        </tr>
              
<jsp:useBean id="estaboleta" scope="page" class="Clases.Boletas" />

<% 
 Integer[] array = estaboleta.buscar_deudas(ID); 
 if(array!=null){
    for(int i=0; i<array.length;i++){
        Integer IDBol = array[i];
        //int IDBol = Integer.parseInt(id_Boleta);        
        estaboleta.cargarResumen(IDBol);
        sumaDeuda=sumaDeuda+estaboleta.getMonto1();        
%>
              
        <tr>
            <td align="center"><jsp:getProperty name="estaboleta" property="periodo" /></td>
            <td align="center">$ <jsp:getProperty name="estaboleta" property="monto1String" /></td>
            <td align="center"><jsp:getProperty name="estaboleta" property="montoActualizadoString" /></td>
            <td align="center"><jsp:getProperty name="estaboleta" property="vencimiento1" /></td>
            <td align="center"><jsp:getProperty name="estaboleta" property="mora" /></td>                
         </tr>
         
            <%}
            }%>
   </table>
</div>
<div align="right" style="margin-bottom: 50px" >
    <div style="display: inline-block"><p class="h12" style="color: blue; background-color: rgba(128, 128, 128, 0.19)">Total adeudado: </p></div>
    <div style="display: inline-block"><p style="color: red; font-size: 14pt; font-weight: bold">$ <%= fd.format(sumaDeuda) %></p></div>  
</div>

<div style="margin-top:50px">
<HR style="size: 2; color: negro"/> 
		<p align="center" style="vertical-align: middle; margin-bottom: 0px; margin-top: 0px"><a href="javascript:onClick=window.print()">Imprimir Resumen</a> - <a href="javascript:onClick=window.close()">Cerrar</a></p>
</div></body>
</html>
